log using c:\data\jleoccp, replace text
*main results
xtmelogit vote retdiff npartdiff partdiff retention npart djudge ijudge closepl closepc factpl catdum3 catdum4 catdum5 || stateid: || judgeid: 
test retdiff-partdiff=0
test retdiff-npartdiff=0
test npartdiff-partdiff=0
margins, predict(fixedonly) dydx(*) atmeans
xtmelogit vote retdiff npartdiff partdiff retention npart djudge ijudge closepl closepc catdum2 catdum3 catdum4 catdum5 || stateid: || judgeid: 
test retdiff-partdiff=0
test retdiff-npartdiff=0
test npartdiff-partdiff=0
margins, predict(fixedonly) dydx(*) atmeans
*without the main effects, because of the collinearity; either include in main table or as appendix table
xtmelogit vote retdiff npartdiff partdiff djudge ijudge closepl closepc factpl catdum3 catdum4 catdum5 || stateid: || judgeid: 
xtmelogit vote retdiff npartdiff partdiff djudge ijudge closepl closepc catdum2 catdum3 catdum4 catdum5 || stateid: || judgeid: 
corr retdiff partdiff npartdiff diff retention part npart if vote!=. & judgepartynogovs!=. 
*alternative way of dealing with the collinearity; for refs table
xtmelogit congruence retention npart ptypop closenew factencourages catdum3 catdum4 catdum5 || stateid: || judgeid: 
xtmelogit congruence retention npart ptypop closenew catdum2 catdum3 catdum4 catdum5 || stateid: || judgeid: 
*without the judgeid (for a footnote, or perhaps in conjunction with discussing the lack of an effect for closepl closepc); for refs
xtmelogit vote retdiff npartdiff partdiff retention npart djudge ijudge closepl closepc factpl catdum3 catdum4 catdum5 || stateid: 
xtmelogit vote retdiff npartdiff partdiff retention npart djudge ijudge closepl closepc catdum2 catdum3 catdum4 catdum5 || stateid: 
* now a basic logit; just for discussion NO TABLE
xtlogit vote retdiff npartdiff partdiff retention npart djudge ijudge closepl closepc factpl catdum3 catdum4 catdum5
test retdiff-partdiff=0
test retdiff-npartdiff=0
test npartdiff-partdiff=0
xtlogit vote retdiff npartdiff partdiff retention npart djudge ijudge closepl closepc catdum2 catdum3 catdum4 catdum5 
test retdiff-partdiff=0
test retdiff-npartdiff=0
test npartdiff-partdiff=0
*Laura Langer's party id:  For Refs table
xtmelogit vote retdiff npartdiff partdiff retention npart djudgelang ijudgelang closepl closepc factpl catdum3 catdum4 catdum5 || stateid: || judgeid: 
xtmelogit vote retdiff npartdiff partdiff retention npart djudgelang ijudgelang closepl closepc catdum2 catdum3 catdum4 catdum5 || stateid: || judgeid: 
*end

